package fun.symtable;

public class VariableEntry implements Comparable<VariableEntry> {
    private String name = "";
    private double value = 0D;

    public VariableEntry(String name) {
	this(name, 0);
    }

    public VariableEntry(String name, double value) {
	this.name = name;
	this.setValue(value);
    }

    public String getName() {
	return this.name;
    }

    public double getValue() {
	return value;
    }

    public void setValue(double value) {
	this.value = value;
    }

    public int compareTo(VariableEntry o) {
	if (null == o)
	    return 1;
	if (this == o)
	    return 0;
	return this.name.compareTo(o.name);
    }

    public String toString() {
	return name + " = " + value;
    }
}
